package no.la58.scribbles.shared;

import java.io.Serializable;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

@SuppressWarnings("serial")
@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Scribble implements Storeable, Serializable {

    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private String key;

    @Persistent
    private String message;

    @Persistent
    private String usermail;

    @Persistent
    private long timeStamp;

    public Scribble() {
	timeStamp = System.currentTimeMillis();
    }

    public Scribble(String message) {
	this();
	this.message = message;
    }

    public void setMessage(String message) {
	this.message = message;
    }

    public String getMessage() {
	return message;
    }

    @Override
    public String getKey() {
	return key;
    }

    @Override
    public void setKey(String key) {
	this.key = key;
    }

    public void setUsermail(String usermail) {
	this.usermail = usermail;
    }

    public String getUsermail() {
	return usermail;
    }

    public long getTimeStamp() {
	return timeStamp;
    }

}
